package com.yatb.trac.pojo.condition;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

import com.yatb.trac.util.SQLCondition;

public class FinderProgettiByIds implements SQLCondition {

	private String[] idProgettis ;
	public FinderProgettiByIds(String[] idProgettis) {
		super();
		this.idProgettis = idProgettis;
	}
	public Criterion create(Object... params) {
		Collection<BigDecimal> ids = new ArrayList<BigDecimal>();
		for (int i = 0; i < idProgettis.length; i++) {
			String object = idProgettis[i];
			ids.add(new BigDecimal(object));
		}
		return Restrictions.in("idProgetto", ids);
		
	}

}
